package ru.susu.algebra.partition.filter;

import ru.susu.algebra.partition.Partition;

/**
 * @author akargapolov
 * @since: 11.03.2009
 */
public class AndPartitionFilter implements IPartitionFilter
{
	private IPartitionFilter[] _filters;

	public AndPartitionFilter(IPartitionFilter... filters)
	{
		_filters = filters;
	}

	@Override
	public boolean checkPartition(Partition partition)
	{
		for (IPartitionFilter filter : _filters)
		{
			if (!filter.checkPartition(partition))
				return false;
		}
		return true;
	}

}
